home *** CD-ROM | disk | FTP | other *** search
Oberon Text | 1990-08-31 | 3.3 KB | 53 lines | [.Ob./.Ob*] |
- Syntax10b.Scn.Fnt
- Syntax10.Scn.Fnt
- Syntax10i.Scn.Fnt
- MacOberon ToolBox Interfaces
- MacOberon offers a simple means for defining interfaces to the Macintosh
- Operating System and Toolbox. A subset of these interfaces is already
- included with MacOberon and additions and further interface modules can
- be created easily. Procedure definitions including a minus sign following
- the PROCEDURE symbol are treated as Interface Procedures; the compiler
- will substitute in-line the byte sequence appearing instead of a procedure
- body when compiling the procedure call.
- Data structures used by the Macintosh Operating System and Toolbox have
- an internal structure different from Oberon structures. To differentiate
- between the two, these interface structures have to be marked by a plus
- sign following the ARRAY, POINTER or RECORD symbol. Only basic types
- or interface structures may be passed to interface procedures. If an interface
- structure is composed of smaller substructures, these must also be marked.
- Oberon structures, on the other hand, may contain interface substructures.
- Compiler.Compile
- MacTypes.Mod/s MacQuickDraw.Mod/s MacMenus.Mod/s
- MacEvents.Mod/s MacTextEdit.Mod/s MacWindows.Mod/s
- MacDesk.Mod/s MacDialogs.Mod/s ~
- SampleApp is an Oberon module that demonstrates how MacOberon may
- be used for constructing Applications that follow the Macintosh User Interface
- Guidelines. It shows how to hide the MacOberon window, Arrow and Menu
- Bar and how to return to MacOberon in an orderly fashion. In the event of a
- trap, Oberon's Menus and Arrow Cursor will automatically be restored.
- Compiler.Compile SampleApp.Mod ~
- SampleApp.Loop (* Choose Quit from File menu to return to Oberon *)
- MacOberon uses resource numbers greater than 32000, while the Operating
- System reserves all numbers smaller than 128. Numbers between these
- two values may be assigned freely to resources belonging to user commands.
- These resources may then be included in the MacOberon application, or
- alternatively may be stored in separate resource files. SampleApp
- demonstrates how to access a resource file "SampleApp.r" (generated from
- SampleApp.Rez).
- When returning to the Main Loop of Oberon, user commands should restore
- the standard Oberon Menu by calling Display.ShowStdMenus . If this is
- inadvertently omitted, the Main Loop will catch the error the next time
- an item is selected from the (improper) menu and cause a trap, resulting in
- the automatic reinstatement of the usual Oberon menus. The procedure
- from module SampleApp which builds the menu bar may thus be called for
- testing purposes, without danger of damaging our Oberon environment.
- SampleApp.SetupSampleLooks
- The "look and feel" of a user application may be tested without actually
- starting its main event loop, from within the Oberon environment. Only
- when the behavior of the individual selectable actions is satisfactory, do we
- need to start with debugging the main loop. As an example, the window
- creation action of SampleApp may be executed without actually going into
- "Macintosh User Interface" mode.
- SampleApp.NewWindow
- Michael Franz, 31.08.90
-